package com.ruoyi.backups.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.backups.mapper.MysqlBackupsMapper;
import com.ruoyi.backups.domain.MysqlBackups;
import com.ruoyi.backups.service.IMysqlBackupsService;

/**
 * mySQL数据源配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-06
 */
@Service
public class MysqlBackupsServiceImpl implements IMysqlBackupsService 
{
    @Autowired
    private MysqlBackupsMapper mysqlBackupsMapper;

    /**
     * 查询mySQL数据源配置
     * 
     * @param id mySQL数据源配置主键
     * @return mySQL数据源配置
     */
    @Override
    public MysqlBackups selectMysqlBackupsById(Long id)
    {
        return mysqlBackupsMapper.selectMysqlBackupsById(id);
    }

    /**
     * 查询mySQL数据源配置列表
     * 
     * @param mysqlBackups mySQL数据源配置
     * @return mySQL数据源配置
     */
    @Override
    public List<MysqlBackups> selectMysqlBackupsList(MysqlBackups mysqlBackups)
    {
        return mysqlBackupsMapper.selectMysqlBackupsList(mysqlBackups);
    }

    /**
     * 新增mySQL数据源配置
     * 
     * @param mysqlBackups mySQL数据源配置
     * @return 结果
     */
    @Override
    public int insertMysqlBackups(MysqlBackups mysqlBackups)
    {
        mysqlBackups.setCreateTime(DateUtils.getNowDate());
        return mysqlBackupsMapper.insertMysqlBackups(mysqlBackups);
    }

    /**
     * 修改mySQL数据源配置
     * 
     * @param mysqlBackups mySQL数据源配置
     * @return 结果
     */
    @Override
    public int updateMysqlBackups(MysqlBackups mysqlBackups)
    {
        mysqlBackups.setUpdateTime(DateUtils.getNowDate());
        return mysqlBackupsMapper.updateMysqlBackups(mysqlBackups);
    }

    /**
     * 批量删除mySQL数据源配置
     * 
     * @param ids 需要删除的mySQL数据源配置主键
     * @return 结果
     */
    @Override
    public int deleteMysqlBackupsByIds(Long[] ids)
    {
        return mysqlBackupsMapper.deleteMysqlBackupsByIds(ids);
    }

    /**
     * 删除mySQL数据源配置信息
     * 
     * @param id mySQL数据源配置主键
     * @return 结果
     */
    @Override
    public int deleteMysqlBackupsById(Long id)
    {
        return mysqlBackupsMapper.deleteMysqlBackupsById(id);
    }
}
